<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Vue指令 v-if</title>
    <script src="https://unpkg.com/vue"></script>
    <link rel="stylesheet" href="if.css">
</head>
<body>
    <div id="vue-app">
        <h1>v-if条件</h1>

        <button v-on:click="error = !error">Toggle error</button>
        <button v-on:click="success = !success">Toggle error</button>
        <p v-if="error">网络错误</p>
        <p v-else-if="success">网路正确</p>

       <!-- <p v-show="error">网络错误</p>
        <p v-show="success">网路正确</p>-->
    </div>

<script src="if.js"></script>
</body>
</html>